﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using QuestionSetLibrary;
using System.Runtime.Serialization.Json;

namespace FormsControlLibraryForWindowsAndWeb
{
    class JsonCovertor
    {
        public static QuestionSet[] GetQuestionSetFormJSON(string jsonString) {
           
            
           DataContractJsonSerializer dcjs = new
             DataContractJsonSerializer(
                typeof(QuestionSet[]));
            System.IO.MemoryStream ms = new
              System.IO.MemoryStream(Encoding.UTF8.GetBytes(jsonString));
            QuestionSet[] myfields = (QuestionSet[])dcjs.ReadObject(ms);
            return myfields;
        }
    }
}
